/*
 * This file is part of WebLookAndFeel library.
 *
 * WebLookAndFeel library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * WebLookAndFeel library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with WebLookAndFeel library.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.alee.managers.version;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamConverter;

import java.io.Serializable;

/**
 * User: mgarin Date: 03.08.12 Time: 16:43
 */

@XStreamAlias ("VersionInfo")
public class VersionInfo implements Serializable
{
    @XStreamAsAttribute
    private String name;

    @XStreamAsAttribute
    private int major;

    @XStreamAsAttribute
    private int minor;

    @XStreamAsAttribute
    private int build;

    @XStreamAsAttribute
    private String type;

    @XStreamAsAttribute
    @XStreamConverter (VersionDateConverter.class)
    private long date;

    @XStreamAsAttribute
    private String comment;

    public VersionInfo ()
    {
        super ();
    }

    public String getName ()
    {
        return name;
    }

    public void setName ( String name )
    {
        this.name = name;
    }

    public int getMajor ()
    {
        return major;
    }

    public void setMajor ( int major )
    {
        this.major = major;
    }

    public int getMinor ()
    {
        return minor;
    }

    public void setMinor ( int minor )
    {
        this.minor = minor;
    }

    public int getBuild ()
    {
        return build;
    }

    public void setBuild ( int build )
    {
        this.build = build;
    }

    public String getType ()
    {
        return type;
    }

    public void setType ( String type )
    {
        this.type = type;
    }

    public long getDate ()
    {
        return date;
    }

    public void setDate ( long date )
    {
        this.date = date;
    }

    public String getComment ()
    {
        return comment;
    }

    public void setComment ( String comment )
    {
        this.comment = comment;
    }

    public String toString ()
    {
        return name + " v." + major + "." + minor + ( build > 0 ? " (build " + build + ")" : "" );
    }
}